//
//  AXMyNewFarmerSubmitCell.m
//  AnXin100
//
//  Created by 天质弘耕 on 2018/11/7.
//  Copyright © 2018 tzhg. All rights reserved.
//

#import "AXMyNewFarmerSubmitCell.h"
#import "ZXCategories.h"
#import "UIView+SDAutoLayout.h"


@interface AXMyNewFarmerSubmitCell ()



@end


@implementation AXMyNewFarmerSubmitCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        [self creatView];
        [self setlayout];
    }
    return self;
    
}

- (void)creatView {
    
    self.SelectBtn = [[UIButton alloc]init];
    [self.SelectBtn setImage:[UIImage imageNamed:@"sexUnselect"] forState:UIControlStateNormal];
    [self.contentView addSubview:self.SelectBtn];
    
    self.agreeLabel = [[UILabel alloc]init];
    self.agreeLabel.text = @"同意入驻协议";
    self.agreeLabel.textColor = COLOR_ORG;
    self.agreeLabel.font = FONT_FOURTEEN;
    [self.contentView addSubview:self.agreeLabel];
    
    self.submiBtn = [[UIButton alloc]init];
    self.submiBtn.backgroundColor = COLOR_GREEN;
    [self.submiBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.submiBtn setTitle:@"确认提交" forState:UIControlStateNormal];
    [self.submiBtn addTarget:self action:@selector(sure:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:_submiBtn];
    
    self.saveBtn = [[UIButton alloc]init];
    self.saveBtn.backgroundColor = COLOR_GREEN;
    [self.saveBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
    [self.saveBtn setTitle:@"保存" forState:UIControlStateNormal];
    [self.saveBtn addTarget:self action:@selector(sure:) forControlEvents:UIControlEventTouchUpInside];
    [self.contentView addSubview:_saveBtn];
    
    
    
    
}

- (void)setlayout {
    
    self.submiBtn.sd_layout
    .rightSpaceToView(self.contentView, 10)
    .topSpaceToView(self.contentView, 0)
    .widthIs(120)
    .heightIs(44);
    
    self.saveBtn.sd_layout
    .centerXEqualToView(self.contentView)
    .topSpaceToView(self.contentView, 0)
    .widthIs(SCREEN_WIDTH-100)
    .heightIs(44);
    
    self.SelectBtn.sd_layout
    .leftSpaceToView(self.contentView, 50)
    .centerYEqualToView(self.submiBtn)
    .widthIs(15)
    .heightIs(15);
    
    self.agreeLabel.sd_layout
    .leftSpaceToView(self.SelectBtn, 10)
    .topSpaceToView(self.contentView, 0)
    .widthIs(100)
    .heightIs(44);
    
    
    
}

#pragma mark - action

- (void)sure:(UIButton *)btn {
    
    if (self.tapButtonClickedBlock) {
        
        self.tapButtonClickedBlock(btn.tag);
    }
}


    
@end
